﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GameManager : MonoBehaviour
{
    public GameObject pause;
    public GameObject start;

    public GameObject controller;
    public GameObject playerSwitch;

    // 获取退出游戏的按钮
    public GameObject quitGameButton;

    public void OnPause()
    {
        start.SetActive(true);
        pause.SetActive(false);
        controller.SetActive(false);
        playerSwitch.SetActive(true);

        quitGameButton.SetActive(true);

        Time.timeScale = 0f;   
    }

    public void OnStart()
    {
        pause.SetActive(true);
        start.SetActive(false);
        controller.SetActive(true);
        playerSwitch.SetActive(false);

        quitGameButton.SetActive(false);

        Time.timeScale = 1f;
    }

    // 退出游戏
    public void QuitGame()
    {
        Application.Quit();
    }
}
